/**
 *
 */
'use strict'
import React from 'react'
import {NavigationContainer} from '@react-navigation/native'
import {createNativeStackNavigator} from '@react-navigation/native-stack'
const Stack = createNativeStackNavigator()

import Setting from '../pages/TestSetting'
import SwithDns from '../pages/TestSwithDns'
import EditSwithDns from '../pages/TestEditSwithDns'

import customNavComponent from './customNav'

const SS = (pn, ui) => {
  return (
    <Stack.Screen
      name={pn}
      component={ui}
      options={props => customNavComponent(props, ui)}
    />
  )
}

function MyStack() {
  return (
    <Stack.Navigator>
      {SS('Setting', Setting)}
      {SS('SwithDns', SwithDns)}
      {SS('EditSwithDns', EditSwithDns)}
      {/* <SS pn='Setting' ui={Setting} />
      <SS pn='SwithDns' ui={SwithDns} />
      <SS pn='EditSwithDns' ui={EditSwithDns} /> */}
    </Stack.Navigator>
  )
  // return (
  //   <Stack.Navigator>
  //     <Stack.Screen name='Setting' component={Setting} />
  //     <Stack.Screen name='SwithDns' component={SwithDns} />
  //     <Stack.Screen name='EditSwithDns' component={EditSwithDns} />
  //   </Stack.Navigator>
  // )
}

export default function App() {
  return (
    <NavigationContainer>
      <MyStack />
    </NavigationContainer>
  )
}
